package com.net.test.service;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.net.test.db.MybatisDAO;


@Service
public class BoardService {

	@Autowired
	MybatisDAO mybatisDAO;
	
	public int insertData(String id, Object obj) throws Exception{
		
		int result = 0;
				
		result = mybatisDAO.insertData(id, obj);
		
		return result;
	}
	
	public int updateData(String id, Object obj) throws Exception{
        
        int result = 0;
                
        result = mybatisDAO.updateData(id, obj);
        
        return result;
    }
	
	public int deleteData(String id, String title) throws Exception{
        
        int result = 0;
                
        result = mybatisDAO.deleteData(id, title);
        
        return result;
    }
	
	public Object selectData(String id) throws Exception{
	    
	    Object lists = "";
	    
	    lists = mybatisDAO.getListData(id);
	    
	    return lists;
	    
	}
	
	public Object viewData(String id, String value) throws Exception{
        
        Object lists = "";
        
        lists = mybatisDAO.getViewDataOne(id,value);
        
        return lists;
        
    }
	
}
